<!DOCTYPE >
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>订单列表</title>


<link rel="stylesheet" type="text/css" href="/system/css/right.css">
<script type="text/javascript" src="/system/js/jquery.js"></script>
<script type="text/javascript" src="/system/js/system.js"></script>
<script type="text/javascript" src="/system/js/admin.js"></script>
</head>

<style>
.table td{
	text-align: left;
	padding-left: 10px;
}
</style>
<body style="overflow: auto;">
	<div class="basic bor">
			<div class="title fl">当前位置：系统管理 > 权限列表</div>
	</div>

	<!-- <form action="{:url('news/addcate')}" method="post"> -->
	<div class="addnav">
		<!-- <a class="submit fr addnews" href="{:url('Homerole/permission_detail')}"   />添加权限</a> -->
	</div>
	<!-- </form> -->

<!-- 文章分类列表 -->
<div class="catelist">
    <div class="lists listsov">
    	<dd>权限列表</dd>
    </div>
</div>
<!-- /文章分类列表 -->
<table border="1"  class="table table-hover text-center" id='list'>
  <tr class="trcolor">
   	<td>权限名称</td>
   	<td>控制器</td>
	  <!-- <td>所属类型</td> -->
	  <td>添加二级</td>
    <td>更新时间</td>
    <td colspan="1">操作</td>
  </tr>
<!-- ============================================================= -->
{volist name="list" id="li"}
  <tr>
    <td> {$li.html} <input type="text" value="{$li.name}"  onchange="upname({$li.id},'name')" value_name_name="{$li.id}" name="name"></td>
    <td><input type="text" value="{$li.val}"  onchange="upname({$li.id},'val')" value_name_val="{$li.id}" name="val"></td>
    <!-- <td><input type="text" value="{$li.category}" onchange="upname({$li.id},'category')" value_name_category="{$li.id}"  name="category"></td> -->
    <td><a href="{:url('Homerole/add_permission',['id'=>$li['id']])}" onclick="return confirm('确认添加二级权限?')">添加二级</a></td>
    <td>{$li['addtime']|date='Y-m-d H:i:s',###}</td>
    <td ><a href = "{:url('Homerole/delete_permission',['id'=>$li['id']])}" onclick="return confirm('确定将此记录删除?')">删除</a></td>
  </tr>
{/volist}
<!-- ============================================================= -->
</table>
<div class="pages">
<script>
	function upname(id,values){
		var name = $('[value_name_'+values+'='+id+']').val();
		$.ajax({
				type:"post",                      //请求类型
				url:'{:url("Homerole/upname")}',           //URL
				data:{'name':name,'id':id,'values':values},   //传递的参数
				dataType:"json",                 //返回的数据类型
				success:function(data){          //data就是返回的json类型的数据
					alert(data.ok);
				}
		});

	}


</script>
</div>
<!-- 提示 -->
<p class="ts"><span class="colorf00">*</span><span class="ts_text"> 如果要修排序请直接点击文字修改。</span></p>
</body>
</html>
